import time
from asyncio import sleep
from async_logs import logs
class Base:

    async_driver=None

    async def get(self,url:str='http://www.baidu.com'):
        await self.async_driver.get(url)
        

class SearchPage(Base):
    async def seacher(self, search: str = '软件测试'):
        await self.async_driver.send_keys('id', 'kw', text=search)
        await self.async_driver.click('id', 'su')


class SearchPage2(SearchPage):
    async def seacher(self,search:str='软件测试'):
        await self.async_driver.send_keys('id','kw',text=search)
        await self.async_driver.click('id','su')
 
class AsyncTestPage(SearchPage2):
    @logs
    async def test_login(self,*args):
        await self.get()
        await sleep(3)
        await self.seacher()
        await sleep(3)
        assert await self.async_driver.find_element('id','kw')